<?php
ob_start();
	
define('DOCROOT', dirname(__FILE__));

//set prefix for sessions
define('PREFIX','smvc_');
define('SESSION_PREFIX','smvc_');

// include config
require('config/config.php');

//include password helper
require('helpers/password.php');

function autoloadsystem($class) {

   $filename = DOCROOT . "/core/" . strtolower($class) . ".php";
   if(file_exists($filename)){
      require $filename;
   }

   $filename = DOCROOT . "/helpers/" . strtolower($class) . ".php";
   if(file_exists($filename)){
      require $filename;
   } 
 
}
spl_autoload_register("autoloadsystem");

set_exception_handler('logger::exception_handler');
set_error_handler('logger::error_handler');

$app = new Bootstrap();
$app->setController('home');
$app->setTemplate('default');
$app->init();

ob_flush();

?>
